/**
 * Created by jiachneyu on 2018/4/20.
 */
const {insert, update, remove} = require('./blog');

const pub = async (body) => {
    const data = {
        ...body,
        pv: 0,
        like: 0,
        discussNum: 0,
        uv: 0
    }
    return await insert(data);
}

const pubUpdate = async body => {
    return await update({_id: body._id}, {$set: body})
}

const removeArt = async body => {
    return await remove({_id: body._id})
}

module.exports = {
    pub: pub,
    pubUpdate: pubUpdate,
    remove: removeArt
};